#include <stm8s_tim1.h>

uint16_t TIM1_GetCapture4(void)
{
  /* Get the Capture 4 Register value */
  uint16_t tmpccr4 = 0;
  uint8_t tmpccr4l=0, tmpccr4h=0;
  
  tmpccr4h = TIM1->CCR4H;
  tmpccr4l = TIM1->CCR4L;
  
  tmpccr4 = (uint16_t)(tmpccr4l);
  tmpccr4 |= (uint16_t)((uint16_t)tmpccr4h << 8);
  /* Get the Capture 4 Register value */
  return (uint16_t)tmpccr4;
}

/**
  * @brief  Gets the TIM1 Counter value.
  * @param  None
  * @retval Counter Register value.
  */
